package Geometry::Point;

our $VERSION = '0.02';

use 5.010000;
use Moose;

# Preloaded methods go here.

has [ 'x', 'y' ]  => (isa => 'Int', is => 'rw', required => 1);

sub clear {
    my $self = shift;
    $self->x(0);
    $self->y(0);
}

sub toString {
    my $self = shift;
    "x = ".$self->x.", y = ".$self->y;
}

package Geometry::Point3D;
use Moose;

extends 'Geometry::Point';

has 'z' => (isa => 'Int', is => 'rw', required => 1);

after 'clear' => sub {
    my $self = shift;
    $self->z(0);
};

sub toString {
    my $self = shift;
    $self->SUPER::toString().", z = ".$self->z;
}

1;

__END__

# Below is stub documentation for your module. You'd better edit it!

=head1 NAME

Geometry::Point - Perl extension for representating cartesian points and 3D points

=head1 SYNOPSIS

  use Geometry::Point;

=head1 DESCRIPTION

This module offers two Moose class definitions for representating cartesian points and cartesian 3D points.
Those type of points has several atributes, each one for each coordinate axis. Also they have a function to
print them on a character array.

=head1 AUTHOR

TEJERA PEREZ, alu3869

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2011 by TEJERA PEREZ

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.10.0 or,
at your option, any later version of Perl 5 you may have available.

=cut
